<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8" />
	<link rel="icon" href="./favicon.ico" />
	<title>测试-快快数据查询统计平台</title>
	<script src="/common/js/vue.js" charset="utf-8"></script>
	<script src="/common/js/jquery.min.js" charset="utf-8"></script>
	<script src="/common/js/echarts.min.js" charset="utf-8"></script>
	<script src="/common/js/md5.js" charset="utf-8"></script>
	<script src="/common/js/vue-easytable.min.js" charset="utf-8"></script>
	<script src="/common/js/axios.min.js" charset="utf-8"></script>
	<script src="/common/js/rd.js" charset="utf-8"></script>
	<script src="chart/chart-options.js" charset="UTF-8"></script>
	<link rel="stylesheet" type="text/css" href="/common/css/vue-easytable.min.css">
	<link rel="stylesheet" type="text/css" href="/common/css/normal.css">
	<link rel="stylesheet" type="text/css" href="css/index.css" />
	<script src="js/index.js"></script>

</head>

<body>
	<div class="container">

		<header class="line" id="header_vm">
			<div class="mainTitle">快快数据统计分析平台（测）</div>
			<div class="logininfo"></div>
		</header>
		<article class="body line">
			<div class="nav">
				
			</div>
			<div class="mainblock">
				<main></main>
			</div>
		</article>
	</div>
</body>
</html>

<script>
<<<<<<< HEAD

	// navito('users', 'topusers');
	// navito('gyms', 'timetable');
	navito('gyms', 'timetable');
=======
	// 在首页定义全局公共变量
	var dataDomain = "http://localhost/"; // 后端数据接口host
	const C = {
		city : '北京',
		gymid : 1383430562842624,  // 通州万达店
		userid: 1785528            // 
	};
	var D = {
		userid: C.userid
	};
	var nav_vm = {userlogin: {user_name: 'wj'}};
	
	var navito = function(path, filename){
		var fname = 'pages/' + path + "/" + filename + ".html"
		$("main").load(fname, function(){
			console.log(fname)
		})
	}
	
	const post = function(url, params, callback){
		$.ajax({
			type: "POST",
			url: url,
			contentType: 'application/json; charset=utf-8',
			data: JSON.stringify(params),
			dataType: 'json',
			success: function(r){
				console.log("ajax successed!")
				callback(r)
			},
			error: function(e){
				console.log("ajax failed!")
				callback(e)
			}
		})
	}
	
	var download = function(filename, columns, datas){
		let file = [];
		let line = [];
		for(let j in columns){
			line.push(columns[j].title);
		}
		file.push(line.join(','));
		for(let j in datas){
			let x = datas[j];
			line = [];
			for(let i in columns){
				line.push("\"" + x[columns[i].field] + "\"");
			}
			file.push(line.join(','));
		}
		let content = file.join('\n')
		// console.log(file.join('\n'));
		let fullfilename = filename + new Date().format('MM-dd') + '.csv';
		console.log(fullfilename)
		$.ajax({
			url: dataDomain + 'data/savefile.php',
			type: 'POST',
			headers: {'content-type': 'application/x-www-form-urlencoded'},
			data: {
				filename: fullfilename, 
				content: content
			},
			dataType: 'text',
			success: function(r){
				console.log(r)
				window.open(dataDomain + "data/download/" + fullfilename, '_blank')
			}
		})
	}
	console.log('domain: ' + document.domain)
	// navito('users', 'topusers');
	// navito('gyms', 'timetable');
	navito('zhibo', 'coach_classes');
>>>>>>> cba9cafd673f42ad5454652a82cea5b5ef9bdc87
	// $.get("http://101.200.201.27/adm/kkdata/kk/user_report_2019.php", {uuid: '00401c6e-557c-4b17-af2f-41549c12d7c3'}, function(r){
	// 	console.log(r)
	// }, 'json')
</script>
